package cn.wuqingna.legendgem.script

import taboolib.common.LifeCycle
import taboolib.common.io.getInstance
import taboolib.common.io.runningClasses
import taboolib.common.platform.Awake

object ScriptManager {
    val map = hashMapOf<String, Script>()

    @Awake(LifeCycle.ENABLE)
    fun init(){
        runningClasses.forEach {
            if (Script::class.java.isAssignableFrom(it)) {
                val script =it.getInstance()?.get() as? Script ?: return@forEach
                map[script.key] = script
            }
        }
    }
}